<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <title>${section.title}</title>
   <meta http-equiv="X-UA-Compatible" content="Edge" />

<!-- Shortcut Icons -->
   <link rel="shortcut icon" href="/share/res/favicon.ico" type="image/vnd.microsoft.icon" /> 
   <link rel="icon" href="/share/res/favicon.ico" type="image/vnd.microsoft.icon" />

<!-- Site-wide YUI Assets -->
<!-- Common YUI components: RELEASE concatenated -->

   <script type="text/javascript" src="/share/res/js/yui-common.js"></script>

<!-- Site-wide Common Assets -->
   <script type="text/javascript" src="/share/res/js/bubbling.v2.1-min.js"></script>
   <script type="text/javascript">//<![CDATA[
      YAHOO.Bubbling.unsubscribe = function(layer, handler)
      {
         this.bubble[layer].unsubscribe(handler);
      }
   //]]></script>
   
   <script type="text/javascript" src="/share/service/messages.js?locale=en_GB"></script>

   <script type="text/javascript" src="/share/res/js/alfresco-min.js"></script>
   <script type="text/javascript" src="/share/res/js/forms-runtime-min.js"></script>
   <script type="text/javascript" src="/share/res/js/share-min.js"></script>
   
   
<!-- Template Assets -->
   <style type="text/css" media="screen">
      @import "/share/res/yui/reset-fonts-grids/reset-fonts-grids.css";
      @import "/share/res/yui/assets/skins/default/skin.css";
      @import "/share/res/css/base.css";
      @import "/share/res/css/yui-layout.css";
      @import "/share/res/themes/default/presentation.css";
      @import "${url.context}/css/login.css";
   </style>

<!-- Component Assets -->


<!-- MSIE CSS fix overrides -->
   <!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="/share/res/css/ie6.css" /><![endif]-->
   <!--[if IE 7]><link rel="stylesheet" type="text/css" href="/share/res/css/ie7.css" /><![endif]-->
   <!--[if IE 8]><link rel="stylesheet" type="text/css" href="/share/res/css/ie8.css" /><![endif]-->
   <#include "/common/tracking.ftl"/>
</head>
<body id="Share" class="yui-skin-default alfresco-share">
   <div class="sticky-wrapper">
      <div id="doc3">
   <div id="alflogin" class="login-panel">
      <div class="login-logo" style="background:url(<@makeurl asset=webSite.logo/>) no-repeat;"></div>
      <form id="loginform" accept-charset="UTF-8" method="post" action="${url.context}/dologin" onsubmit="return alfLogin();">
         <div style="float:left;">
	         <fieldset>	
	            <div style="padding-top:105px">
	               <label id="txt-username" for="username"></label>
	            </div>
	            <div style="padding-top:4px">
	               <input type="text" id="username" name="username" maxlength="255" style="width:200px" value="" />
	            </div>
	            <div style="padding-top:12px">
	
	               <label id="txt-password" for="password"></label>
	            </div>
	            <div style="padding-top:4px">
	               <input type="password" id="password" name="password" maxlength="255" style="width:200px"/>
	            </div>
	            <div style="padding-top:16px">
	               <input type="submit" id="btn-login" class="login-button" />
	            </div>
	            
	            <#if url.args.page??>
	            <input type="hidden" id="success" name="success" value="${url.args.page}"/>
	            <input type="hidden" name="failure" value="${url.context}/login/?page=${url.args.page}&error=true"/>
	            <#else>
	            <input type="hidden" id="success" name="success" value="${url.context}/product/"/>
	            <input type="hidden" name="failure" value="${url.context}/login/?error=true"/>
	            </#if>
	         </fieldset>
	         <div style="padding:25px 0 5px 0; float:left; display:block;">
	         	<span class="login-copyright">&copy; CARBONES 2011. All rights reserved</span>
	      	 </div>
	      </div>
         <@region id="info-right" scope="page"/>        
      </form>      
   </div>
   
   <script type="text/javascript">//<![CDATA[
   function alfLogin()
   {
      YAHOO.util.Dom.get("btn-login").setAttribute("disabled", true);
      return true;
   }
   
   YAHOO.util.Event.onContentReady("alflogin", function()
   {
      var Dom = YAHOO.util.Dom;
      
      // Prevent the Enter key from causing a double form submission
      var form = Dom.get("loginform");
      if (form)
      {
         // add the event to the form and make the scope of the handler this form.
         YAHOO.util.Event.addListener(form, "submit", this._submitInvoked, this, true);
         var fnStopEvent = function(id, keyEvent)
         {
            if (form.getAttribute("alflogin") == null)
            {
               form.setAttribute("alflogin", true);
            }
         }

         var enterListener = new YAHOO.util.KeyListener(form,
         {
            keys: YAHOO.util.KeyListener.KEY.ENTER
         }, fnStopEvent, "keydown");
         enterListener.enable();

         // set I18N labels
         Dom.get("txt-username").innerHTML = Alfresco.util.message("label.username") + ":";
         Dom.get("txt-password").innerHTML = Alfresco.util.message("label.password") + ":";
         Dom.get("btn-login").value = Alfresco.util.message("button.login");
      }
      
      // generate and display main login panel
      var panel = new YAHOO.widget.Overlay(YAHOO.util.Dom.get("alflogin"), 
      {
         modal: false,
         draggable: false, // NOTE: Don't change to "true"
         fixedcenter: true,
         close: false,
         visible: true,
         iframe: false
      });
      panel.render(document.body);
      
      Dom.get("success").value += window.location.hash;
      Dom.get("username").focus();
   });
      
    
      <#if url.args.error??>
      
      Alfresco.util.PopupManager.displayPrompt(
   	  {

	      title: Alfresco.util.message("message.loginfailure"),
	      text: Alfresco.util.message("message.loginautherror"),
	      buttons: [
	      {
	         text: Alfresco.util.message("button.ok"),
	         handler: function error_onOk()
	         {
	            this.destroy();
	            YAHOO.util.Dom.get("username").focus();
	            YAHOO.util.Dom.get("username").select();
	         },
	         isDefault: true
	      }]
   	  }); 
   	  </#if>
   	   
   //]]></script>
      </div>
      <div class="sticky-push"></div>
   </div>
</body>
</html>